<?php

namespace App\Http\Controllers\H5;


use App\Traits\Cms\PostTrait;
use Illuminate\Http\Request;

class PostController extends BaseController
{

    use PostTrait;

    /**
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function index()
    {

        $catlogs = $this->catlogRepository()->all();
        return $this->view('h5.post.index', compact('catlogs'));
    }

    protected function showDetailView(Request $request, $post)
    {
        $relations = $post->catlog->posts()->take(5)->get();
        return $this->view('h5.post.detail', compact('post', 'relations'));
    }
}
